package com.zc.manager.notify.util;

/**
 * 通知类型和服务商对应关系
 */
public enum ProviderUtil {
    EMBEDDED("email","embedded","默认"),
    DING_TALK_MESSAGE("dingTalk","dingTalkMessage","钉钉消息通知"),
    ALI_YUN_SMA("sms","aliyunSms","阿里云短信服务"),
    CORP_MESSAGE("weixin","corpMessage","微信企业消息通知"),
    ALI_YUN("voice","aliyun","语音阿里云服务");



    private String key;
    private String value;
    private String name;

    //获取value
    public static String getValue(String key) {
        if(null != key){
            for(ProviderUtil enumTest : ProviderUtil.values()){
                if(key.equals(enumTest.getKey())){
                    return enumTest.getValue();
                }
            }
        }
        return key;
    }

    //获取name
    public static String getName(String key) {
        if(null != key){
            for(ProviderUtil enumTest : ProviderUtil.values()){
                if(key.equals(enumTest.getKey())){
                    return enumTest.getName();
                }
            }
        }
        return key;
    }

    //初始化 构造
    ProviderUtil(String key, String value,String name) {
        this.key = key;
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getKey() {
        return key;
    }
    public void setKey(String key) {
        this.key = key;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }



}
